Component({
  data: {
    showModal: false,
    fileName: null,
    fileUrl: null,
    fileClassify: null,
    filesStatus: {},
    fileid: '',
    btnStatus: false,

  },
  properties: {
    classify: String,
    fileListData: Object,
    editstatus: Boolean,
    isNightMode: Boolean
  },
  methods: {
    submit: function (obj) {
      this.setData({
        showModal: true
      })
      this.setData({
        fileName: obj.currentTarget.dataset.filename,
        fileUrl: obj.currentTarget.dataset.fileurl,
        fileClassify: obj.currentTarget.dataset.fileclassifyid,
        fileid: obj.currentTarget.dataset.fileclassifyid,
      })
    },
    preventTouchMove: function () {},
    closeModal: function () {
      this.setData({
        showModal: false
      })
    },
    selection(e) {
      this.setData({
        btnStatus: !this.data.btnStatus
      }, function () {
        let obj = this.data.filesStatus
        obj[e.currentTarget.dataset.id] = this.data.btnStatus
        this.setData({
          filesStatus: obj
        })
        console.log(this.data.filesStatus)
      })
    },
    goUploadFile() {
      wx.switchTab({
        url: '/pages/upload/upload'
      })
    }

  }
})